package com.fjec.market.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fjec.market.entity.*;
import com.fjec.market.view.ShopVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 001.市场表 服务类
 * </p>
 *
 * @author admin
 * @since 2020-09-07
 */
public interface IInfoMarketService extends IService<InfoMarket> {
    Map<String, Object> getMarkets(Page page);

    Map<String, Object> getMarketByCode(Integer markCode);

    Map<String, Object> getSectionBusinesses(Integer markCode, int sectionVal, Page page);

    List<ShopVO> getShopVOsByBusiIds(List<Long> busiIds, Long userId);

    List<ShopVO> extendFarmer(List<InfoFarmer> farmers, Long thisUserId, boolean top2);

    List<ShopVO> extendBusiness(List<InfoBusiness> businesses, Long userId, boolean top2);

    List<ShopVO> extendPurchase(List<InfoPurchase> purchases, Long userId, boolean top2);

    List<Map<String, Object>> getProducts(int markCode, int busiType, String title, int orderBy, int dir, Page page);

    InfoSku getProductById(Long id);

    ShopVO getShopIndexById(Long id, Integer busiType);

    int saveMarketDevOps(InfoMarket infoMarket, String markPic, String markMapPic);

    Map<String, Object> getSessionInfo(Long userId, int busiType);

    /**
     * 根据userId获取用户名称及头像等信息
     *
     * @param userId
     * @return
     */
    Map<String, Object> getSessionInfoByUserId(Long userId);

    List<ShopVO> getFarmerSkuByIds(List<Long> followingShopIds);

    List<ShopVO> getPurchaseByIds(List<Long> followingShopIds);

    List<ShopVO> getBusinessSkuByIds(List<Long> followingShopIds);

    List<ShopVO> getMyFollowing(Long userId, Integer busiType, Page page);

    List<Integer> getMarkCodesByBusiId(Long busiId, Integer busiType);

    List<ShopVO> getShopVOsByGivingUserIds(List<Long> givingUserIds, Long userId);

    List<InfoMarket> getMarketsByBusiId(Long busiId);

    List<Map<String, Object>> getRetailFruits(Integer markCode, Integer orderBy, Integer dir, Page page);

    List<Map<String, Object>> getAllMarketLocation();

    List<InfoMarket> getMarketsHavingSection(Integer sectionVal);

    Map<String, Object> getMarketLocation(Integer markCode);

    Map<String, Object> getDevopsMarkets(Page page);

    /**
     * 更新市场轮播图
     *
     * @param markCode
     * @param marketRotation
     * @return
     */
    boolean updateMarketRotation(Integer markCode, List<Map<String, Object>> marketRotation);
}
